package com.llmcu.graphic.designpatterns.command;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * xxxx
 *
 * @author liuling
 * @date 2024/7/20 16:23
 */
@Getter
@Setter
public class MacroDrawCommand implements Command{
    List<Command> commandList = new ArrayList<>();

    @Override
    public void execute() {
        for (Command next : commandList) {
            next.execute();
        }
    }

    public void add(Command command) {
       commandList.add(command);
    }

    public void clear() {
        commandList.clear();
    }
}
